* Replication for "Who Stopped the Equal Rights Amendment?" by James M. Strickland, State Politics and Policy Quarterly
* Results created in Stata version 19

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\IG Populations Dataset.dta"

* For creating statistics in Table 1, except for last row:

tab year

egen contracts_c = total(contracts), by(year)

tabulate year, sum(contracts_c)

egen proera_c = total(proera), by(year)

tabulate year, sum(proera_c)

egen stopper_c = total(stopper), by(year)

tabulate year, sum(stopper_c)

egen womenslobby_c = total( now+ lwv +aauw +misc +nwpc +lgbt +zero ), by(year)

tabulate year, sum(womenslobby_c)

* For creating last row of statistics in Table 1:

gen womenslobby = now+ lwv +aauw +misc +nwpc +lgbt +zero

total contracts proera stoppers womenslobby

* For creating scatterplot in Figure 1:

gen totalera = proera+stoppers

gen lntotal = ln(totalera+1)

egen average = mean(lntotal) if ratified==1, by(count)

sort count

graph twoway (scatter lntotal count if fips==18 & lntotal!=0, connect(1)) (scatter average count if ratified==1 & count>=-4, connect(1)) (scatter lntotal count if ratified==1), legend(position(6)) xlabel(-8(1)10, nogrid)

graph export Figure1.png,width(1800)

* The labels on the y axis are then adjusted to reflect non-logged values. For example, if a state had two lobbyists, then its initial value would be ln(3) = 1.098. 

* For creating scatterplot in Figure 2:

egen average2 = mean(lntotal) if ratified==0, by(year)

sort year

graph twoway (scatter lntotal year if fips==12 & lntotal!=0, connect(1)) (scatter average2 year if ratified==0 & year>=1969, connect(1)) (scatter lntotal year if ratified==0 & year>=1969), legend(position(6)) xlabel(1969(1)1982, nogrid)

* The labels on the y axis are then adjusted to reflect non-logged values. For example, if a state had two lobbyists, then its initial value would be ln(3) = 1.098. 

clear

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\Main Dataset.dta"

* For creating data in Table 2:

tabulate state year if venue=="House" & firstcluster==1

tabulate state year if venue=="Senate" & firstcluster==1

* For creating histograms in Figure 3:

hist year if firstcluster==1, frequency xlabel(1973(1)1982) bin(10)

hist year, frequency xlabel(1973(1)1982) bin(10)

* For creating statistics in Table 3: 

tab yes_vote if republican==0 & woman==0 & nonwhite==0
tab yes_vote if republican==1 & woman==0 & nonwhite==0
tab yes_vote if republican==0 & woman==1 & nonwhite==0
tab yes_vote if republican==1 & woman==1 & nonwhite==0
tab yes_vote if republican==0 & woman==0 & nonwhite==1
tab yes_vote if republican==1 & woman==0 & nonwhite==1
tab yes_vote if republican==0 & woman==1 & nonwhite==1
tab yes_vote if republican==1 & woman==1 & nonwhite==1

* For creating statistics in Table 4:

sum publicsupport if firstcluster==1, det

tab yes_vote if republican==0 & publicsupport <= 0.51586
tab yes_vote if republican==1 & publicsupport <= 0.51586
tab yes_vote if republican==0 & publicsupport > 0.51586 & publicsupport <=0.5658
tab yes_vote if republican==1 & publicsupport > 0.51586 & publicsupport <=0.5658
tab yes_vote if republican==0 & publicsupport > 0.5658 & publicsupport <=0.6481
tab yes_vote if republican==1 & publicsupport > 0.5658 & publicsupport <=0.6481
tab yes_vote if republican==0 & publicsupport > 0.6481
tab yes_vote if republican==1 & publicsupport > 0.6481

* For creating results in Table 5:

* Model 1:

logit yes_vote eralobbyists stoppers insurance woman nonwhite publicsupport lobbyefforts i.fips i.year if republican==0, cluster(cluster)

estat class

* Model 2:

logit yes_vote eralobbyists stoppers insurance woman nonwhite publicsupport lobbyefforts i.fips i.year if republican==1, cluster(cluster)

estat class

* Model 3:

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite publicsupport republican repxera repxstoppers repxinsurance repxwoman repxnonwhite repxsupport i.fips i.year, cluster(cluster)

estat class

* For creating predicted probabilities presented in Figure 4:

margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 eralobbyists=0 repxera=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 eralobbyists=5 repxera=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 eralobbyists=10 repxera=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 eralobbyists=15 repxera=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 eralobbyists=20 repxera=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 eralobbyists=25 repxera=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 eralobbyists=30 repxera=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 eralobbyists=35 repxera=0 repxsupport==0) atmeans

margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 eralobbyists=0 repxera=0 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 eralobbyists=5 repxera=5 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 eralobbyists=10 repxera=10 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 eralobbyists=15 repxera=15 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 eralobbyists=20 repxera=20 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 eralobbyists=25 repxera=25 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 eralobbyists=30 repxera=30 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 eralobbyists=35 repxera=35 repxsupport==.50) atmeans

* Statistics from the preceding commands are then used to create Figure 4: 

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\Figure 4 statistics.dta"

twoway (line predicted lowerci upperci eralobbyists if republican==0)(line predicted lowerci upperci eralobbyists if republican==1)

clear

* For creating predicted probabilities presented in Figure 5:

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\Main Dataset.dta"

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite publicsupport republican repxera repxstoppers repxinsurance repxwoman repxnonwhite repxsupport i.fips i.year, cluster(cluster)

margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 stoppers=0 repxstoppers=0 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 stoppers=20 repxstoppers=20 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 stoppers=40 repxstoppers=40 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 stoppers=60 repxstoppers=60 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 stoppers=80 repxstoppers=80 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 stoppers=100 repxstoppers=100 repxsupport==.50) atmeans

margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 stoppers=0 repxstoppers=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 stoppers=20 repxstoppers=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 stoppers=40 repxstoppers=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 stoppers=60 repxstoppers=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 stoppers=80 repxstoppers=0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 stoppers=100 repxstoppers=0 repxsupport==0) atmeans

* Statistics from the preceding commands are then used to create Figure 5: 

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\Figure 5 statistics.dta"

twoway (line predicted lowerci upperci stoppers if republican==0)(line predicted lowerci upperci stoppers if republican==1)

clear

* For creating results in Table 6:

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\Main Dataset.dta"

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite publicsupport republican repxera repxstoppers repxinsurance repxwoman repxnonwhite repxsupport i.fips i.year, cluster(cluster)

margins, at(nonwhite==0 woman==0 republican==0 repxera==0 repxstoppers==0 repxinsurance==0 repxwoman==0 repxnonwhite==0 repxsupport==0) atmeans
margins, at(nonwhite==1 woman==0 republican==0 repxera==0 repxstoppers==0 repxinsurance==0 repxwoman==0 repxnonwhite==0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==1 republican==0 repxera==0 repxstoppers==0 repxinsurance==0 repxwoman==0 repxnonwhite==0 repxsupport==0) atmeans
margins, at(nonwhite==1 woman==1 republican==0 repxera==0 repxstoppers==0 repxinsurance==0 repxwoman==0 repxnonwhite==0 repxsupport==0) atmeans

margins, at(nonwhite==0 woman==0 republican==1 repxera==2.622176 repxstoppers==4.900943 repxinsurance==34.39563 repxwoman==0 repxnonwhite==0 repxsupport==.5813708) atmeans
margins, at(nonwhite==0 woman==1 republican==1 repxera==2.622176 repxstoppers==4.900943 repxinsurance==34.39563 repxwoman==1 repxnonwhite==0 repxsupport==.5813708) atmeans
margins, at(nonwhite==1 woman==0 republican==1 repxera==2.622176 repxstoppers==4.900943 repxinsurance==34.39563 repxwoman==0 repxnonwhite==1 repxsupport==.5813708) atmeans
margins, at(nonwhite==1 woman==1 republican==1 repxera==2.622176 repxstoppers==4.900943 repxinsurance==34.39563 repxwoman==1 repxnonwhite==1 repxsupport==.5813708) atmeans

* For creating results in Figure 6: 

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\Main Dataset.dta"

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite publicsupport republican repxera repxstoppers repxinsurance repxwoman repxnonwhite repxsupport i.fips i.year, cluster(cluster)

margins, at(nonwhite==0 woman==0 publicsupport=.0 republican==0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.20 republican==0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.40 republican==0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.60 republican==0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.70 republican==0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.80 republican==0 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport= 1.0 republican==0 repxsupport==0) atmeans

margins, at(nonwhite==0 woman==0 publicsupport=.0 republican==1 repxsupport==0) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.20 republican==1 repxsupport==.20) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.40 republican==1 repxsupport==.40) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.50 republican==1 repxsupport==.50) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.60 republican==1 repxsupport==.60) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.70 republican==1 repxsupport==.70) atmeans
margins, at(nonwhite==0 woman==0 publicsupport=.80 republican==1 repxsupport==.80) atmeans
margins, at(nonwhite==0 woman==0 publicsupport= 1.0 republican==1 repxsupport==1.0) atmeans

* Statistics from the preceding commands are then used to create Figure 6: 

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\Figure 6 statistics.dta"

twoway (line predicted lowerci upperci publicsupport if republican==0)(line predicted lowerci upperci publicsupport if republican==1)

clear

* For creating results in Table 7:

* Model 4: 

use "C:\Users\james\OneDrive\Desktop\Published Papers and Papers Under Review\ERA Lobbying\Version 3 (SPPQ accept)\Replication Files\Main Dataset.dta"

logit yes_vote eralobbyists stoppers insurance woman nonwhite publicsupport lobbyefforts i.fips i.year if republican==0 & votenumber==1, cluster(cluster)

estat class

* Model 5:

logit yes_vote eralobbyists stoppers insurance woman nonwhite publicsupport lobbyefforts i.fips i.year if republican==1 & votenumber==1, cluster(cluster)

estat class

* Model 6:

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite publicsupport republican repxera repxstoppers repxinsurance repxwoman repxnonwhite repxsupport i.fips i.year if votenumber==1, cluster(cluster)

estat class
 
* For creating results in Table 8:

* Model 7:

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite public i.fips i.year if republican!=1 & south!=1, cluster(cluster)

estat class

* Model 8:

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite public i.fips i.year if  republican==1 & south!=1, cluster(cluster)

estat class

* Model 9:

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite publicsupport republican repxera repxstoppers repxinsurance repxwoman repxnonwhite repxsupport i.fips i.year if south!=1, cluster(cluster)

estat class

* Model 10:

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite public i.fips i.year if republican!=1 & south==1, cluster(cluster)

estat class

* Model 11:

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite public i.fips i.year if republican==1 & south==1, cluster(cluster)

estat class

* Model 12:

logit yes_vote eralobbyists stoppers insurance lobbyefforts woman nonwhite publicsupport republican repxera repxstoppers repxinsurance repxwoman repxnonwhite repxsupport i.fips i.year if south==1, cluster(cluster)

estat class